package com.example.demotest.demotest.vo;

import com.example.demotest.demotest.aspect.AnnotationRange;
import com.example.demotest.demotest.aspect.BigDecimalRange;
import com.example.demotest.demotest.aspect.DateFormatRange;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author x_weidanlang
 * @version 1.0
 * @date 2022/2/9 9:34
 */
@Data
public class UserVo  implements Serializable {
    @NotNull(message = "编号不可为空")
    private Integer userId;
    @NotNull(message = "姓名不可为空")
    private String userName;
    @NotNull(message = "年龄不可为空")
    private Integer age;
    @NotNull(message = "性别不可为空")
    private String sex;
    @NotNull(message = "数字不可为空")
    @AnnotationRange(message = "参数不在范围内")
    private Integer number;
    @NotNull(message = "数字不可为空")
    @BigDecimalRange(message = "数据格式错误")
    private BigDecimal agreedYield;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateFormatRange(message = "时间格式不正确")
    @NotNull(message = "时间不可为空")
    private String createTime;
}
